package com.tywj.panda.customer.common.widget.recyclerview

import androidx.lifecycle.LifecycleOwner
import com.tywj.lib.lifecycle.livedata.ArrayListLiveData
import com.tywj.lib.lifecycle.livedata.ListChangedObserver
import com.tywj.lib.core.widget.recycleview.adapter.BaseMultiItemAdapter
import com.chad.library.adapter.base.entity.MultiItemEntity

/**
 * @desc RecyclerView多Item类型适配器
 * @author June Yang
 * @date 2020/5/13
 */
open class MyBaseMultiItemAdapter<T : MultiItemEntity> : BaseMultiItemAdapter<T>() {

    fun setArrayListLiveData(lifecycleOwner: LifecycleOwner, liveData: ArrayListLiveData<T>) {
        setNewData(liveData.rawList)

        ListChangedObserver(lifecycleOwner, this, liveData)
    }
}